UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Xro0S9wlj6raT6txrN38FvZHqcEtzMYDqaGRdcl+U1c='
WHERE
key_id = 'fe6a9e91fbc9baad57c1a99c8f8c376e9ed904f4f364b15f1ccd815f1250b224'
AND (
token = 'Xro0S9wlj6raT6txrN38FvZHqcEtzMYDqaGRdcl+U1c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)