UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RNnQ+kMcefK/WeuKB2t3ga8DP0vMaOzYr5phKHIfvBk='
WHERE
key_id = '59cdba5d05e815f0f0d19071a2122b80db92233b957700400a28459a3b5206a6'
AND (
token = 'RNnQ+kMcefK/WeuKB2t3ga8DP0vMaOzYr5phKHIfvBk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)