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