UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'a5ZpTsk1DPqGKiPNQ/oYXiKJJ7kzR5aKybji12ZLs5o='
WHERE
key_id = '05eb972d4175b6d2e57a4bf3237113a9093f825ff270e5d28b2c6739801b5d5f'
AND (
token = 'a5ZpTsk1DPqGKiPNQ/oYXiKJJ7kzR5aKybji12ZLs5o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)