UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5cu5gHeKwWIqZ4DpHj3xgA97Gw1tGoQKhi+NT95Ti1o='
WHERE
key_id = 'c2f3b02a890dbb0d342f002e1717d5aeda92da1d74c04c725ce2258dadd9bc88'
AND (
token = '5cu5gHeKwWIqZ4DpHj3xgA97Gw1tGoQKhi+NT95Ti1o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)