UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Fc9GqKwBPI7nipm8WAzaRHwiFX4kxQbSGEGsVA9ESqM='
WHERE
key_id = 'b73a24fb9ffcd84eac2eb824882a3fe52f5e4e2f2a41b94d20df68ec32528efd'
AND (
token = 'Fc9GqKwBPI7nipm8WAzaRHwiFX4kxQbSGEGsVA9ESqM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)