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