UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ou35BIwBNnK8siDRpUgTILZmGYm+rONbu7QeyaYu9Mw=' 
WHERE 
  key_id = '7876cf5c0b3b527c6e57b60f132623890dc9367daac7274ad906d8956bcb05d7' 
  AND (
    token = 'ou35BIwBNnK8siDRpUgTILZmGYm+rONbu7QeyaYu9Mw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035