UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jd2sFOM+q6zCl9SwRfLrtg5/4rxUoo3NCzJhbRxcza8='
WHERE
key_id = '3c90e989d3ae583214b620502c95429e3c9038ad5bcb947536f10d517d705868'
AND (
token = 'jd2sFOM+q6zCl9SwRfLrtg5/4rxUoo3NCzJhbRxcza8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)