UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bFg7zDNuhGW1zVMVxmfJSVdET+sySjcswbN/zxCfsek='
WHERE
key_id = 'fd4a8f22511ea71e1e4c6cca674295aa3bee96305f68d843556bfa2ac7f8154c'
AND (
token = 'bFg7zDNuhGW1zVMVxmfJSVdET+sySjcswbN/zxCfsek='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)