UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yyh5x0C0501ygpaVi/0gOIS1UWo9xnkemJ1gZZoH0nY='
WHERE
key_id = '0cf323ace5081c25de2a13a1d86976843bc3a0af6ba7c2f0a8911482ae970302'
AND (
token = 'yyh5x0C0501ygpaVi/0gOIS1UWo9xnkemJ1gZZoH0nY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)