UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oR7w9XLb9QQPmxXHHfFwMZ+qVp5q26KIce9+gATWojE='
WHERE
key_id = '67937e34d2288e65c62437029e15d2a62512242ec165ccbf324ce6d19ecaf40f'
AND (
token = 'oR7w9XLb9QQPmxXHHfFwMZ+qVp5q26KIce9+gATWojE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)