UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oTV7D9tUQ2fSNwqCzr8xOSQYbrKC1skpQe8XcEEjHDU='
WHERE
key_id = '2779cd2b7f1ff1e77225fa16146084316b6c3385994fabe236648a7a653ffb76'
AND (
token = 'oTV7D9tUQ2fSNwqCzr8xOSQYbrKC1skpQe8XcEEjHDU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)