UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wpUHwQORv4rFvKrBukiicqs/DjJU780a8iqEXuIyMG8='
WHERE
key_id = '5d296e9c0aa541aa5bc44d481a4c10e7941924b1283e3e2a60f288da6e2dbcab'
AND (
token = 'wpUHwQORv4rFvKrBukiicqs/DjJU780a8iqEXuIyMG8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)