UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gfUjNX91Wu3EErn3ka+b3L8FxqIxEC8uXFm3/Bq/U30='
WHERE
key_id = 'ec5933c81e80f39822d7064ef2052182dc98dd6584f456b484a02929af3f24ed'
AND (
token = 'gfUjNX91Wu3EErn3ka+b3L8FxqIxEC8uXFm3/Bq/U30='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)