UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BP0omr7XHQX2FZW/BzDb2Sbk01qWxFjqktNFawgSNUU=' 
WHERE 
  key_id = '60dd36f54473f3ab4223723be4941e3f747a0b3cd80bfd1d42b7f23a1bccbbb7' 
  AND (
    token = 'BP0omr7XHQX2FZW/BzDb2Sbk01qWxFjqktNFawgSNUU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032