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