UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ua4sqVdaNLVhNPXntijeYe57gaR69Eddm9thxtsIfjc='
WHERE
key_id = '6dd2e6eb22f4c9be41c35cb68ef2aed42e239f80071a5e0b9415e7e8e8b7b57f'
AND (
token = 'ua4sqVdaNLVhNPXntijeYe57gaR69Eddm9thxtsIfjc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)