UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '43fPLk6fiyPH6Ltj6qx9FAiQRzrmHn2xBrAcHtWeXh4='
WHERE
key_id = '30580c4a956330cbf554e7c16329b36db1d55ea6d887c7b5e35152877ef8107a'
AND (
token = '43fPLk6fiyPH6Ltj6qx9FAiQRzrmHn2xBrAcHtWeXh4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)